﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;

namespace ABC.General
{
    public static class Departments
    {
        public static List<string> getDepartmentList()
        {
            List<string> listOfDepartments = new List<string>();
            string sqlstring = "SELECT DISTINCT [DEPARTMENT] FROM tabCAT";
            {
                try
                {
                    OleDbCommand command = new OleDbCommand(sqlstring, ABC.Database.DataBaseConnection.MyConn);
                    OleDbDataReader aReader = command.ExecuteReader();
                    listOfDepartments.Add("*");
                    while (aReader.Read())
                    {


                        listOfDepartments.Add(aReader[0].ToString());
                    }
                }
                catch (Exception )
                {
                    throw;
                }
            }

            return listOfDepartments;
        }
    }
}
